import axios from '@/libs/request'

// 驳回单人
export const updateRejectOne = (data) => {
  return axios.request({
    // url: '/api/as/dangan/record/updateRejectOne',
    url: '/api/ac/dangan/recordConnectionService/updateRejectOne',
    data: data,
    type: 'post'
  })
}
// 已接收单人驳回
export const updateReceived = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/updateRejectOne',
    data: data,
    type: 'post'
  })
}
// 已接收批量驳回
export const updateRejectBatch = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/updateRejectBatch',
    data: data,
    type: 'post'
  })
}
// 档案转送列表抽检查询
export const getRecordCheckList = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getRecordCheckList',
    data: data,
    type: 'post'
  })
}
// 总上报人数
export const getZSPeopleTotal = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getZSPeopleTotal',
    data: data,
    type: 'post'
  })
}

// 根据身份证号获取人员信息
export const findDataByIdcards = (data) => {
  return axios.request({
    url: '/api/ac/dangan/excelService/findDataByIdcards',
    data: data,
    type: 'post'
  })
}
// 档案接收驳回
export const updateRecordStatus = (data) => {
  return axios.request({
    url: '/api/ac/dangan/archivesService/updateRecordStatus',
    data: data,
    type: 'post',
    await: true
  })
}
// 档案材料修改（新）
export const updateCLState = (data) => {
  return axios.request({
    // url: '/api/ac/dangan/recordConnectionService/updateCLState',
    url: '/api/ac/dangan/recordOperationService/updateMaterials',
    data: data,
    type: 'post',
    await: true
  }).catch(ret => {
    console.log('接口发生错误', ret)
  })
}
// 查询机构信息（所有操作前调用）
export const getOfficeInfo = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getOfficeInfo',
    data: data,
    type: 'post'
  })
}
// 修改全宗号
export const updateRecordNumber = (data) => {
  return axios.request({
    // url: '/api/as/dangan/record/updateRecordNumber',
    url: '/api/ac/dangan/rnService/saveRecordNumber',
    data: data,
    type: 'post'
  })
}
// 数据导入前身份证校验
export const validateUniqueCardnoList = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/validateUniqueCardnoList',
    data: data,
    type: 'post'
  })
}
// 数据导入(通用)
export const saveExcelData = (data) => {
  return axios.request({
    url: '/api/ac/dangan/excelService/saveExcelData',
    data: data,
    type: 'post'
  })
}
// 数据导入(档案)
export const saveRecordpl = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/saveRecordpl',
    data: data,
    type: 'post'
  })
}
// 根据参数获取接口
export const recordListParam = (data) => {
  return axios.request({
    url: '/api/ac/dangan/recordConnectionService/findReceivePageList',
    data: data,
    type: 'post'
  })
}
/**
 * 获取列表
 * @param data
 * @returns {*}
 */
export const recordList = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getRecordList',
    data: data,
    type: 'post'
  })
}

/**
 * 新增接口
 * @param data
 * @returns {*}
 */
export const saveAndUpdateUser = (data) => {
  return axios.request({
    // url: '/api/as/dangan/record/saveUser',
    url: '/api/ac/dangan/recordOperationService/saveAndUpdateArchieves',
    data: data,
    type: 'post'
  })
}

export const getRecordById = (id) => {
  return axios.request({
    url: '/api/as/dangan/record/getRecordById ',
    data: { id: id },
    type: 'post'
  })
}
/**
 * 档案转送
 * @param data
 * @returns {*}
 */
export const updaterecordConnection = (data) => {
  return axios.request({
    url: '/api/ac/dangan/recordConnectionService/updaterecordConnection ',
    data: data,
    type: 'post'
  })
}
/**
 * 档案转送列表
 * @param data
 * @returns {*}
 */
export const getRecordConnectionList = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getRecordConnectionList',
    data: data,
    type: 'post'
  })
}
/**
 * 分配流水号
 * @param data
 * @returns {*}
 */
export const updateSerialNum = (data) => {
  return axios.request({
    url: '/api/ac/dangan/recordConnectionService/updateSerialNum',
    data: data,
    type: 'post'
  })
}
/**
 *  接收档案
 * @param data
 * @returns {*}
 */
export const updateRecordState = (data) => {
  return axios.request({
    url: '/api/ac/dangan/recordConnectionService/updateRecordState',
    data: data,
    type: 'post'
  })
}
export const getRecordZSList = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getRecordZSList',
    data: data,
    type: 'post'
  })
}
/**
 * 档案列表数量统计
 * @param data
 * @returns {*}
 */
export const getRecordNum = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getRecordNum',
    data: data,
    type: 'post'
  })
}
/**
 * 材料列表数量统计
 * @param data
 * @returns {*}
 */
export const getMaterialTypePersonalNum = (id) => {
  return axios.request({
    url: '/api/as/dangan/record/getMaterialTypePersonalNum',
    data: { achieve_id: id },
    type: 'post'
  })
}
/**
 * 档案接收数量统计
 * @param data
 * @returns {*}
 */
export const getRecordJSNum = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getRecordJSNum',
    data: data,
    type: 'post'
  })
}
/**
 * 获取接收机构
 * @param data
 * @returns {*}
 */
export const getOfficeList = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getOfficeList',
    data: data,
    type: 'post'
  })
}
/**
 * 获取单个人的档案材料数据列表
 * @param data
 * @returns {*}
 */
export const getPersonalMaterialList = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getPersonalMaterialList',
    data: data,
    type: 'post'
  })
}
/**
 * 档案材料增删改查
 * @param data
 * @returns {*}
 */
export const savePersonalMaterial = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/savePersonalMaterial',
    data: data,
    type: 'post',
    await: true
  }).catch(ret => {
    console.log('接口发生错误', ret)
  })
}
/**
 * 批量删除
 * @param data
 * @returns {*}
 */
export const delMaterialAll = (data) => {
  return axios.request({
    // url: '/api/as/dangan/record/deleteMaterialbatch',
    url: '/api/ac/dangan/recordOperationService/updateMaterialsDel',
    data: data,
    type: 'post',
    await: true
  }).catch(ret => {
    console.log('接口发生错误', ret)
  })
}
/**
 * 档案数
 * @param data
 * @returns {*}
 */
export const findDAList = (data) => {
  return axios.request({
    url: '/api/ac/dangan/officeReportService/findDAList',
    data: data,
    type: 'post'
  })
}
/**
 *  机构列表
 * @param data
 * @returns {*}
 */
export const findList = (data) => {
  return axios.request({
    url: '/api/ac/dangan/officeReportService/findList',
    data: data,
    type: 'post'
  })
}
// 统计机构列表
export const findCompanyList = (data) => {
  return axios.request({
    url: '/api/as/dangan/report/findCompanyList',
    data: data,
    type: 'post'
  })
}

/**
 *  企业数和接受机构数  企业 ENT 接收机构 REV
 * @param data
 * @returns {*}
 */
export const findOfficeReport = (data) => {
  return axios.request({
    url: '/api/ac/dangan/officeReportService/findOfficeReport',
    data: data,
    type: 'post'
  })
}
/**
 *  各类型材料数
 * @param data
 * @returns {*}
 */
export const materialsReport = (data) => {
  return axios.request({
    url: '/api/ac/dangan/officeReportService/materialsReport',
    data: data,
    type: 'post'
  })
}
/**
 *  各类型人数占比
 * @param data
 * @returns {*}
 */
export const archivesReport = (data) => {
  return axios.request({
    url: '/api/ac/dangan/officeReportService/archivesReport',
    data: data,
    type: 'post'
  })
}
/**
 *  接受总数
 * @param data
 * @returns {*}
 */
export const recordReport = (data) => {
  return axios.request({
    url: '/api/ac/dangan/officeReportService/recordReport',
    data: data,
    type: 'post'
  })
}
// 统计接收总数
export const getStatisticJSNum = (data) => {
  return axios.request({
    url: '/api/as/dangan/report/getStatisticJSNum',
    data: data,
    type: 'post'
  })
}
// 材料查询接口
export const getMaterialByIDCardList = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getMaterialByIDCardList',
    data: data,
    type: 'post'
  })
}
// 已接收人员列表查询(可查询全部接收机构)
export const getReceivedList = (data) => {
  return axios.request({
    url: '/api/as/dangan/archives/getReceivedList',
    data: data,
    type: 'post'
  })
}
// 已接收人员列表查询（已接收机构适用）
export const getReceivedByCodeList = (data) => {
  return axios.request({
    url: '/api/as/dangan/archives/getReceivedByCodeList',
    data: data,
    type: 'post'
  })
}
// 统计材料总数
export const getMaterialsNumByPerson = (data) => {
  return axios.request({
    url: '/api/as/dangan/record/getMaterialsNumByPerson',
    data: data,
    type: 'post'
  })
}
// 查询此人是否在白名单里
export const getCardNo = (data) => {
  return axios.request({
    url: '/api/ac/dangan/whiteService/getCardNo',
    data: data,
    type: 'post',
    await: true
  })
}
// 白名单导入
export const insertCardName = (data) => {
  return axios.request({
    url: '/api/ac/dangan/whiteService/insertCardName',
    data: data,
    type: 'post'
  })
}
// 白名单查询
export const getCardNoList = (data) => {
  return axios.request({
    url: '/api/ac/dangan/whiteService/getCardNoList',
    data: data,
    type: 'post'
  })
}
// 新增编辑白名单
export const insertCard = (data) => {
  return axios.request({
    url: '/api/ac/dangan/whiteService/insertCard',
    data: data,
    type: 'post'
  })
}
// 删除白名单
export const deleteByID = (data) => {
  return axios.request({
    url: '/api/ac/dangan/whiteService/deleteByID',
    data: data,
    type: 'post'
  })
}
// 查询各企业已接收人数
export const getEterpriseNameList = (data) => {
  return axios.request({
    url: 'api/as/dangan/archives/getEterpriseNameList',
    data: data,
    type: 'post'
  })
}

// 修改流水号
export const updateSerialNumber = (data) => {
  return axios.request({
    url: 'api/as/dangan/archives/updateSerialNumber',
    data: data,
    type: 'post'
  })
}
